package com.testing.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("demo")
public class DemoController {

    @GetMapping("list")
    @ResponseBody
    public String list() {
        return "list";
    }

    @PostMapping("map")
    @ResponseBody
    public Map<String, Object> map() {
        Map<String, Object> map = new HashMap<>();
        map.put("test", "name");
        map.put("aaa", 123);
        map.put("eee", 555);
        return map;
    }
}
